package com.zp.business.service.prescription;

import com.zp.business.api.prescription.PrescriptionItem;
import com.zp.business.api.prescription.bo.PrescriptionItemBo;
import com.zp.business.api.prescription.vo.PrescriptionItemVo;
import com.zp.common.myBatis.core.page.PageQuery;
import com.zp.common.myBatis.core.page.TableDataInfo;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 处方子prescription_itemService接口
 *
 * @author zhang peng
 * @ date 2024-03-22
 */
public interface IPrescriptionItemService {

    /**
     * 查询处方子prescription_item
     */
    PrescriptionItemVo queryById(String itemId);

    /**
     * 查询处方子prescription_item列表(分页)
     */
    TableDataInfo<PrescriptionItemVo> queryPageList(PrescriptionItemBo bo, PageQuery pageQuery);

    /**
     * 查询处方子prescription_item列表(不分页)
     */
    List<PrescriptionItemVo> queryList(PrescriptionItemBo bo);

    /**
     * 修改处方子prescription_item
     */
    Boolean insertByBo(PrescriptionItemBo bo);

    /**
     * 修改处方子prescription_item
     */
    Boolean updateByBo(PrescriptionItemBo bo);

    /**
     * 校验并批量删除处方子prescription_item信息
     */
    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);

    /**
     * 根据applyId删除处方明细
     *
     * @param applyId
     * @return
     */
    Boolean deleteByApplyId(String applyId);

    /**
     * 批量保存
     *
     * @param list
     * @return
     */
    List<PrescriptionItem> saveBatch(List<PrescriptionItemBo> list);

    /**
     * 查询子列表map
     *
     * @param bo
     * @return
     */
    Map<String, Object> listPrescriptionItemMap(PrescriptionItemBo bo);

    /**
     * 确认发放
     *
     * @param bo
     * @return
     */
    Boolean grantInfoOk(PrescriptionItemBo bo);

    /**
     * 确认退药
     *
     * @param bo
     * @return
     */
    Boolean issuedGrantInfoOk(PrescriptionItemBo bo);
}
